/// Created by Nazariy Jaworski Copyright (c) 2013
/// Bot program
///
/// bot.h - Main class of the program
///
/// To Do list:
///  - Threadsafety
///  - ...
///
/// v 0.1        02.04.2013
///

#ifndef BOT_H
#define BOT_H

#include "botcommunicator.h"
#include "botui.h"
#include <QtCore/QCoreApplication>
#include <QFile>

class Bot : public QCoreApplication
///< Main program class
{
    Q_OBJECT

    public: bool            isOk;
    ///< If is not Ok - shutdown application :), default - true
    public: bool            isBusy;
    ///< If is busy - has an task, defaul - false

    // Defenition of his main objects

    public: BotCommunicator *myCommunicator;

    private: Bot(int argc, char **argv);    ///< Common constructor

    public: void Init();                    ///< Initialization, run only onse

    private: ~Bot();                        ///< Common destructor

    public: static Bot *GetInstance();      ///< Getting the Instance of Bot singleton

    public: Q_SLOT void SLOT_FatalError(const QString message);
    ///< Handler for exceptions, write error-message to log exit from program

    public: Q_SIGNAL void SIGNAL_WriteUIString(const QString message)  const;
    ///< If Bot need to inform user about something, he emits this signal
    ///< try to chatch it with UI

    public: Q_SIGNAL void SIGNAL_WriteToLog(const QString message)  const;
    ///< Signal for writing data to log file

};

#endif // BOT_H
